package com.yifan.xmlTool.entity;

import com.yifan.xmlTool.annotation.IDocument;
import com.yifan.xmlTool.annotation.IElement;
import com.yifan.xmlTool.interfaces.BaseObject;
import com.yifan.xmlTool.util.XMLUtil;
import lombok.Data;
import lombok.SneakyThrows;
import org.dom4j.Element;

import java.io.*;

/**
 * @Author YIFan
 * @Date 2021/3/1 17:12
 * @Version 1.0
 */
@IDocument(name = "Object")
@Data
public class Teacher  extends BaseObject implements Serializable {

    @IElement(name = "Property", params = { "Name" }, paramsValue = { "name" })
    private String name;
    @IElement(name = "Property", params = { "Name" }, paramsValue = { "age" })
    private String age;
    @IElement(name = "Property", params = { "Name" }, paramsValue = { "sex" })
    private String sex;

    @Override
    public Element toObject() {
        return new XMLUtil(this).toElement();
    }
}
